package com.heima.wemedia;


import com.heima.aliyun.scan.GreenScan;
import com.heima.aliyun.scan.ScanResult;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Arrays;

@SpringBootTest
public class SecurityDemo {

    @Autowired
    GreenScan greenScan;

    @Test
    public void textScan(){
        try {
            ScanResult result = greenScan.greenTextScan("小小冰毒");
            System.out.println(result);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void imagesScan(){
        try {
            ScanResult scanResult = greenScan.imageUrlScan(Arrays.asList
                    ("https://hmtt143.oss-cn-shanghai.aliyuncs.com/material/2022/7/20220705/dee7b1eced294044b28a15f6cac56c99.jpg"));
            System.out.println(scanResult);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
